home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / AshtrayII / PigLatinTranslation.r < prev    next >
Text File  |  1992-06-22  |  4KB  |  152 lines

  1. /*
  2.     File:        SampleFileTranslationExt.r
  3.  
  4.     Contains:    Sample resource shell for writing a File Translation Extension.
  5.  
  6.     Copyright:    © 1990-1992 by Apple Computer, Inc., all rights reserved.
  7.  
  8.  
  9. */
  10.  
  11.  
  12.  
  13. #include "Types.r"
  14. #include "TranslationExtensions.h"
  15. #include "ExtendedBundleTypes.r"
  16.  
  17.  
  18. #define kSignature                 'PIGH'    /* set this to creator signature of extension */
  19. #define kComponentFileType        'thng'    /* 'thng' => ComponentMgr component file */
  20.  
  21.  
  22. type 'thng' {
  23.     hex longint        type;
  24.     hex longint        subType;
  25.     hex longint        manufacturer;
  26.     hex    longint        flags;
  27.     hex    longint     flagsMask;
  28.     hex longint        thingResType;    
  29.     int             thingResID;
  30.     hex longint      thingNameResType;
  31.     int             thingNameResID;
  32.     hex longint      thingInfoResType;
  33.     int             thingInfoResID;
  34.     hex longint      thingIconResType;
  35.     int             thingIconResID;
  36. };
  37.  
  38.  
  39. resource 'thng' (128, locked) {
  40.     'xlat',                                /* all Translation Extensions have type = 'xlat' */
  41.     'file',                                /* 'file' or 'scrp'  */
  42.     kSignature,                            /* manufacturer should be same as creator signature */
  43.     kFileTranslationExtensionAPIversion,/* api version is 1 */
  44.     0,                                    /* mask is ignored and should be 0 */
  45.     'xlat',128,                            /* code resource */
  46.     'STR ',128,                            /* name string */
  47.     'STR ',129,                            /* information string */
  48.     'ICON',128                            /* extension icon */
  49. };
  50.  
  51.  
  52. Include "PigLatinTranslation.rsrc";        // get 'xlat' code
  53.  
  54.  
  55. resource 'STR ' (128, purgeable) {
  56.     "Pig Latin Translation"
  57. };
  58.  
  59. resource 'STR ' (129, purgeable) {
  60.     "This translates to and from Pig Latin. "
  61.     "Put it in the extension folder to make it work. "
  62. };
  63.  
  64. resource 'ICON' (128, purgeable) {
  65.     $"7FFF FFF0 8000 0008 8000 0008 8000 0008"
  66.     $"8000 0008 8000 0008 8000 0008 8000 0008"
  67.     $"A000 0008 D000 000A 9000 000D 1000 0009"
  68.     $"1000 0001 1000 0001 1000 0001 1000 0001"
  69.     $"1000 0001 1000 0001 1000 0001 1000 0001"
  70.     $"1000 0009 9000 000D D000 000A A000 0008"
  71.     $"8000 0008 8000 0008 8000 0008 8000 0008"
  72.     $"8000 0008 8000 0008 8000 0008 7FFF FFF0",
  73. };
  74.  
  75.  
  76. data 'PICT' (150) {
  77.     $"0094 FFFF FFFF 002B 009B 1101 A000 82A1"            /* .î.....+.õ..†.Ç° */
  78.     $"0096 000C 0200 0000 0200 0000 0000 0000"            /* .ñ.............. */
  79.     $"A100 9A00 0800 0B00 0000 3200 0001 000A"            /* °.ö.......2..... */
  80.     $"0000 0000 002A 009A 2C00 0C00 1509 4865"            /* .....*.ö,....ΔHe */
  81.     $"6C76 6574 6963 6103 0015 0D00 0C2E 0004"            /* lvetica...¬..... */
  82.     $"0000 0100 2B1B 0A15 5069 6720 4C61 7469"            /* ....+...Pig Lati */
  83.     $"6E20 7472 616E 736C 6174 6F72 0D2B 080E"            /* n translator¬+.. */
  84.     $"1162 7920 4E69 636B 204B 6C65 647A 696B"            /* .by Nick Kledzik */
  85.     $"200D 2B11 0E07 4D61 6348 6163 6BA0 0097"            /*  ¬+...MacHack†.ó */
  86.     $"A000 83FF"                                          /* †.É. */
  87. };
  88.  
  89.  
  90. resource 'BNDL' (128) {
  91.     'PIGH',
  92.     0,
  93.     {    /* array TypeArray: 2 elements */
  94.         /* [1] */
  95.         'ICN#',
  96.         {    /* array IDArray: 5 elements */
  97.             /* [1] */
  98.             0, 128,
  99.         },
  100.         /* [2] */
  101.         'FREF',
  102.         {    /* array IDArray: 5 elements */
  103.             /* [1] */
  104.             0, 128,
  105.         }
  106.     }
  107. };
  108.  
  109. resource 'FREF' (128) {
  110.     'thng',
  111.     0,
  112.     ""
  113. };
  114.  
  115. resource 'ICN#' (128, purgeable) {
  116.     {    /* array: 2 elements */
  117.         /* [1] */
  118.         $"7FFF FFF0 8000 0008 8000 0008 8000 0008"
  119.         $"8000 0008 8000 0008 8000 0008 8000 0008"
  120.         $"A000 0008 D000 000A 9000 000D 1000 0009"
  121.         $"1000 0001 1000 0001 1000 0001 1000 0001"
  122.         $"1000 0001 1000 0001 1000 0001 1000 0001"
  123.         $"1000 0009 9000 000D D000 000A A000 0008"
  124.         $"8000 0008 8000 0008 8000 0008 8000 0008"
  125.         $"8000 0008 8000 0008 8000 0008 7FFF FFF0",
  126.     /* [2] */
  127.         $"7FFF FFF0 FFFF FFF8 FFFF FFF8 FFFF FFF8"
  128.         $"FFFF FFF8 FFFF FFF8 FFFF FFF8 FFFF FFF8"
  129.         $"FFFF FFF8 DFFF FFFA 9FFF FFFF 1FFF FFFF"
  130.         $"1FFF FFFF 1FFF FFFF 1FFF FFFF 1FFF FFFF"
  131.         $"1FFF FFFF 1FFF FFFF 1FFF FFFF 1FFF FFFF"
  132.         $"1FFF FFFF 9FFF FFFF DFFF FFFA FFFF FFF8"
  133.         $"FFFF FFF8 FFFF FFF8 FFFF FFF8 FFFF FFF8"
  134.         $"FFFF FFF8 FFFF FFF8 FFFF FFF8 7FFF FFF0"
  135.     }
  136. };
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143. resource 'kind' (128)
  144. {
  145.     'PIGH',
  146.     verUS,
  147.     {
  148.     'PIGL',        "Pig Latin document",
  149.     'TEXT',        "Pig Latin document",
  150.     }    
  151. };
  152.